/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.fandi.util;

import java.awt.Dimension;
import javax.swing.JDesktopPane;
import javax.swing.JInternalFrame;

/**
 *
 * @author Fandy
 */
public class CenteringJInternalFrame {
    public static void setCenter(JDesktopPane desktopPane, JInternalFrame internalFrame) {
        Dimension paneSize = desktopPane.getSize();
        Dimension internalFrameSize = internalFrame.getSize();
        internalFrame.setLocation((paneSize.width - internalFrameSize.width)/2, (paneSize.height- internalFrameSize.height)/2);
    }
}
